import $axios from './request';

// account模块
export const $accountAdd = (data) => {
    return $axios.post('/account/add', data);
}
export const $accountEdit = (data) => {
    return $axios.post('/account/edit', data);
}
export const $accountList = () => {
    return $axios.get('/account/list');
}
export const $accountLogin = (params) => {
    return $axios.post('/account/login', params);
}
export const $accountDel = (data = {}) => {
    return $axios.post('/account/del', data);
}

// security模块
export const $securityAdd = (data) => {
    return $axios.post('/security/add', data);
}
export const $securityList = () => {
    return $axios.get('/security/list');
}
export const $securityEdit = (data = {}) => {
    return $axios.post('/security/edit', data);
}
export const $securityDel = (data = {}) => {
    return $axios.post('/security/del', data);
}

// measure模块
// export const $measureAdd = (data)=> {
//     return $axios.post('/measure/add',data);
// }
// export const $measureList = ()=> {
//     return $axios.get('/measure/list');
// } 
// export const $measureDel = (data={})=> {
//     return $axios.post('/measure/del',data);
// }
// export const $measureEdit = (data={})=> {
//     return $axios.post('/measure/edit',data);
// }
export const $measureAdd = (data) => {
    return $axios.post('/measurement/add', data);
}
export const $measureList = (data) => {
    return $axios.get('/measurement/list', data);
}
export const $measureDel = (data = {}) => {
    return $axios.post('/measurement/del', data);
}
export const $measureEdit = (data = {}) => {
    return $axios.post('/measurement/edit', data);
}


// sensor模块
export const $sensorAdd = (data) => {
    return $axios.post('/sensor/add', data);
}
export const $sensorList = (params) => {
    return $axios.get('/sensor/list', { params });
}
export const $sensorDel = (data = {}) => {
    return $axios.post('/sensor/del', data);
}
export const $sensorCount = () => {
    return $axios.get('/sensor/count');
}
export const $sensorChangGroup = (params) => {
    return $axios.get('/sensor/changeGroup', { params });
}

// group模块
export const $groupList = (params = {}) => {

    return $axios.get('/group/list', { params });
}
export const $groupAdd = (params = {}) => {
    return $axios.get('/group/add', { params });
}
export const $groupDetail = (params = {}) => {
    return $axios.get('/group/detail', { params });
}
export const $groupEdit = (params = {}) => {
    return $axios.get('/group/edit', { params });
}
export const $groupDel = (params = {}) => {
    return $axios.get('/group/del', { params });
}

// device设备
export const $deviceCount = () => {
    return $axios.get('/device/count');
}
export const $deviceSensorList = () => {
    return $axios.get('/device/sensorList');
}

// demo模块
export const $demoAdd = (data = {}) => {
    return $axios.post('/demo/add', data);
}
export const $demoDel = (data = {}) => {
    return $axios.post('/demo/del', data);
}
export const $demoEdit = (data = {}) => {
    return $axios.post('/demo/edit', data);
}
export const $demoList = (params = {}) => {
    return $axios.get('/demo/list', { params });
}

// 计费模块
export const $feeAdd = (data = {}) => {
    return $axios.post('/fee/recharge', data); // 充值
}
export const $feeDel = (data = {}) => {
    return $axios.post('/fee/del', data);
}
export const $feeEdit = (data = {}) => {
    return $axios.post('/fee/edit', data);
}
export const $feeBalance = (params = {}) => {
    return $axios.get('/fee/balance', { params });
}
export const $feeRechargeList = (params = {}) => {
    return $axios.get('/fee/rechargeList', { params }); // 充值记录
}
export const $feeUsageList = (params = {}) => {
    return $axios.get('/fee/usageList', { params }); // 使用记录
}



//网关模块
export const $gateWayList = (data = {}) => {
    return $axios.post('/gateway/list', data);
}

